do not leak the GIcon.
authorPaolo Borelli <pborelli@katamail.com>
Tue, 10 Jun 2008 11:50:43 +0000 (11:50 +0000)
committerPaolo Borelli <pborelli@src.gnome.org>
Tue, 10 Jun 2008 11:50:43 +0000 (11:50 +0000)
2008-06-10  Paolo Borelli  <pborelli@katamail.com>

* gtk/gtkfilesystem.c (gtk_file_system_volume_render_icon): do not
leak the GIcon.

svn path=/trunk/; revision=20346

ChangeLog
gtk/gtkfilesystem.c

index a9aae30f23cbb285c5836aba1374a092a7d7933d..425e36d039b7edee82cb3d81fc8408b82a4b73ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-06-10  Paolo Borelli  <pborelli@katamail.com>
+
+       * gtk/gtkfilesystem.c (gtk_file_system_volume_render_icon): do not
+       leak the GIcon.
+
 2008-06-10  Carlos Garnacho  <carlos@imendio.com>
 
        * configure.in:
index 095b71229dd48c05239a151f09efc1e2a0b5bd2f..aa89a2c11514646cddb21da505b65f1461e3b9b6 100644 (file)
@@ -1697,6 +1697,7 @@ gtk_file_system_volume_render_icon (GtkFileSystemVolume  *volume,
                                    GError              **error)
 {
   GIcon *icon = NULL;
+  GdkPixbuf *pixbuf;
 
   DEBUG ("volume_get_icon_name");
 
@@ -1713,6 +1714,7 @@ gtk_file_system_volume_render_icon (GtkFileSystemVolume  *volume,
 
       file = g_mount_get_root (mount);
       icon = get_icon_for_special_directory (file);
+      g_object_unref (file);
 
       if (!icon)
        icon = g_mount_get_icon (mount);
@@ -1721,7 +1723,11 @@ gtk_file_system_volume_render_icon (GtkFileSystemVolume  *volume,
   if (!icon)
     return NULL;
 
-  return get_pixbuf_from_gicon (icon, widget, icon_size, error);
+  pixbuf = get_pixbuf_from_gicon (icon, widget, icon_size, error);
+
+  g_object_unref (icon);
+
+  return pixbuf;
 }
 
 void